<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no" />
  <title>色谱报告</title>
  <!--标准mui.css-->
  <link rel="stylesheet" href="../css/mui.min.css" />
  <script src="../js/mui.min.js"></script>
  <!--App自定义的css-->
  <link rel="stylesheet" type="text/css" href="../css/app.css" />
  <script src="../js/vue.js"></script>
  <script src="../js/jquery-3.6.0.min.js"></script>
  <script src="../js/sm2.js"></script>
  <script src="../js/sm3.js"></script>
  <script src="../js/feedback.js"></script>
  <script src="../js/clipboard.js"></script>
  <script src="../js/flexible.js"></script>
  <script src="../wx/uap.js"></script>
  <script src="../js/vconsole.min.js"></script>
  <script src="./text.js" type="text/javascript"></script>
  <script type="text/javascript" src="../js/json2.js"></script>
  <style>
    .trainTicketstitle {
      background-image: linear-gradient(to right,
          rgb(13, 121, 131),
          rgb(25, 179, 182));
      padding: 0.3rem 0.2rem;
      color: #fff;
      height: 1rem;
      font-size: 0.35rem;
    }

    .mui-btn-blue,
    .mui-btn-primary,
    input[type="submit"] {
      background-color: rgb(25, 179, 182);
      color: #fff;
      border: 1px solid rgb(25, 179, 182);
      border-radius: 4px;
      margin-right: 10px;
    }

    .left {
      text-align: center;
    }

    .left a {
      line-height: 0.5rem;
      color: #fff;
    }

    .left .left1 {
      position: absolute;
      left: 0.1rem;
      top: 0.25rem;
    }

    .left :nth-child(1) span {
      line-height: 0.5rem;
      color: #fff;
    }

    .left :nth-child(2) span {
      line-height: 0.5rem;
      color: #fff;
    }

    .file-input {
      opacity: 0;
      height: 100%;
      width: 100%;
      z-index: 1;
      position: absolute;
      left: 0;
      top: 0;
    }

    .top {
      height: 10rem;
      width: 100%;
      box-sizing: border-box;
      font-size: 0.3rem;
      /* border: 3px dashed rgb(25, 179, 182); */
      position: relative;
      border-radius: 10px;
      padding: 0.3rem;
      margin-bottom: 0.3rem;
      position: relative;
      margin-top: 1rem;
      background: #fff;
      /* width: 80%;
            height: 80%; */
    }

    .bgcImg {
      width: 60%;
      height: 3rem;
      margin: 0 auto;
      background: url("../image/printTop.png") center;
      background-size: 100% 100%;
      margin-top: 2.5rem;
      margin-bottom: 3.3rem;
    }

    .frontandback {
      /* position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%); */
      font-size: 0.35rem;
      padding: 0.1rem 0.2rem;
      /* border-radius: 6%;
            background: rgb(179, 179, 179);
            opacity: 0.8;
            color: #fff;
            border-radius: 10px; */
    }

    .form {
      padding: 0.2rem;
      line-height: 0.5rem;
      /* background: #fff; */
      margin: 0.2rem 0.2rem 0.2rem;
    }

    .foot {
      position: fixed;
      bottom: 0px;
      left: 0px;
      box-sizing: border-box;
      padding: 0.2rem;
      background-color: #fff;
      width: 100%;
      box-shadow: 4px -4px 4px #eee;
      text-align: center;
    }

    .line1 {
      position: absolute;
      top: 0;
      left: 0px;
      width: 100%;
      height: 100%;
      z-index: 111;
    }

    .lineFlag1 {
      display: none;
      width: 100%;
      -webkit-animation: bounce-down1 2s linear infinite;
      animation: bounce-down1 2s linear infinite;
    }

    @-webkit-keyframes bounce-down1 {
      25% {
        -webkit-transform: translateY(1.5rem);
      }

      50% {
        -webkit-transform: translateY(4rem);
      }

      100% {
        -webkit-transform: translateY(7.5rem);
      }
    }

    @keyframes bounce-down1 {
      25% {
        transform: translateY(7.5rem);
      }

      50% {
        transform: translateY(4rem);
      }

      100% {
        transform: translateY(0);
      }
    }

    .line {
      position: absolute;
      top: 0.3rem;
      left: 0px;
      width: 100%;
      height: 9.2rem;
      z-index: 111;
    }

    .lineFlag {
      display: none;
      width: 100%;
      -webkit-animation: bounce-down 2s linear infinite;
      animation: bounce-down 2s linear infinite;
    }

    @-webkit-keyframes bounce-down {
      25% {
        -webkit-transform: translateY(0.15rem);
      }

      50% {
        -webkit-transform: translateY(4.55rem);
      }

      100% {
        -webkit-transform: translateY(9.2rem);
      }
    }

    @keyframes bounce-down {
      25% {
        transform: translateY(9.2rem);
      }

      50% {
        transform: translateY(4.55rem);
      }

      100% {
        transform: translateY(0.15rem);
      }
    }

    .mui-toast-container {
      top: 50%;
    }

    .form .title1 {
      font-size: 0.35rem;
      font-weight: 600;
      color: #333;
      margin-bottom: 0.2rem;
    }

    .title .titleline {
      /* height: 0.3rem; */
      /* border: 2px solid rgb(25, 179, 182); */
      /* margin-right: 0.2rem;
            margin-top: 0.07rem; */
    }

    .clipboardContent {
      background-color: rgb(251, 247, 247);
      padding: 0.4rem;
      position: relative;
      height: calc(100vh - 3.5rem);
    }

    .clipboardContent img {
      width: 0.3rem;
    }

    .content1 {
      overflow: scroll;
      height: 100%;
      padding: 0.1rem 0.2rem;
      word-wrap: break-word;
    }

    .frontandback .bottom2 {
      position: absolute;
      bottom: 0;
      right: 0;
      margin-right: 0.2rem;
      margin-bottom: 0.2rem;
      width: 0.3rem;
    }

    .frontandback .left2 {
      position: absolute;
      top: 0;
      right: 0;
      margin-right: 0.2rem;
      margin-top: 0.2rem;
      width: 0.3rem;
    }

    .frontandback .left1 {
      position: absolute;
      top: 0;
      left: 0;
      margin-left: 0.2rem;
      margin-top: 0.2rem;
      width: 0.3rem;
    }

    .frontandback .bottom1 {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 0.3rem;
      margin-left: 0.2rem;
      margin-bottom: 0.2rem;
    }

    .topImg .bottom2 {
      position: absolute;
      top: 0;
      left: 0;
      margin-left: 0.2rem;
      padding-top: 0.2rem;
      width: 0.3rem;
    }

    .bottomImg .left2 {
      position: absolute;
      bottom: 0;
      left: 0;
      margin-left: 0.2rem;
      width: 0.3rem;
      padding-bottom: 0.2rem;
    }

    .bottomImg .left1 {
      position: absolute;
      bottom: 0;
      right: 0;
      margin-right: 0.2rem;
      width: 0.3rem;
      padding-bottom: 0.2rem;
    }

    .topImg .bottom1 {
      position: absolute;
      right: 0;
      top: 0;
      width: 0.3rem;
      margin-right: 0.2rem;
      padding-top: 0.2rem;
    }
  </style>
</head>

<body>
  <div id="app">
    <!-- 提示信息 -->
    <div class="is-loading">
      <div class="curtain">
        <div class="loadingBgc">
          <div class="loader"></div>
          <!-- <p class='loadingF'>正在识别</p> -->
        </div>
      </div>
    </div>
    <div class="trainTickets">
      <!-- 头部 -->
      <div class="trainTicketstitle">
        <div class="arrow clearfix">
          <div class="left">
            <span class="left1" @click="home">
              <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
              <!-- <span>返回</span> -->
            </span>
            <!-- <van-icon name="arrow-left" /> -->
            <span style="font-weight: 600">报告上传</span>
          </div>
        </div>
      </div>

      <div></div>
      <!-- 中间 -->
      <div style="padding: 0px 0.25rem; text-align: center" v-show='clipboard.content==""'>
        <div class="top" @click="functionBtn" ref="top">
          <img :src="addedPreviewFile" style="width: 100%; height: 100%" alt="" ref="img" class="img"
            v-if="addedPreviewFile !== ''" />

          <div v-if="addedPreviewFile == ''">
            <p class="bgcImg"></p>
            <p style="font-size: 0.3rem">点击上传报告</p>
          </div>
          <div class="frontandback">
            <div class="uldisplay1 topImg">
              <img src="../image/left-1.png" alt="" class="left1" />

              <img src="../image/left-2.png" alt="" class="left2" />
            </div>
            <!-- <p class="content1">{{clipboard.content}}</p> -->
            <div class="uldisplay1 bottomImg">
              <img src="../image/bottom-1.png" alt="" class="bottom1" />
              <img src="../image/bottom-2.png" alt="" class="bottom2" />
            </div>
          </div>
          <div class="line">
            <img style="display: none; width: 100%" src="../image/scan_line.png" alt="" class="lineFlag"
              ref="lineFlag" />
          </div>
        </div>
      </div>
      <div v-if="isflageIOX==true">
        <input type="file" id="inputer" class="file-input4 file-input" style="display: none" ref="inputer" />
      </div>
      <div v-else></div>
      <div class="form" v-show='clipboard.content!=""'>
        <p class="titleline"></p>
      </div>
    </div>
    <!-- <div class="foot" v-show='clipboard.content !=""'>
        <button
          id="openFile"
          class="mui-btn mui-btn-primary tag-read"
          @click="copy"
          type="button"
        >
          复制文本
        </button>
        <button
          id="openFile"
          class="mui-btn mui-btn-primary"
          @click="mailbox"
          type="button"
        >
          发送邮箱
        </button>
      </div> -->
  </div>
  <script>
    new Vue({
      el: "#app",

      data() {
        return {
          isflageIOX: true,
          form: "",
          VoiceItem: {},
          clipboard: {
            content: "",
          },
          addedPreviewFile: "", //上传图片的base64
          timestamp: "", //时间戳
          // accesstoken: "", //token
          fileName: "",
          slocalResPath: [],
          checkList: "",
          reportCode: "",
        };
      },
      created() {
        this.compatibleInput();
        // let a = { b:'123'}
        // let c = JSON.stringify(a)
        // sessionStorage.setItem("Authentication",c)
        this.getNotification();
      },
      methods: {
        // 判断安卓还是ios
        compatibleInput() {
          //获取浏览器的userAgent,并转化为小写
          var ua = navigator.userAgent.toLowerCase();
          //判断是否是苹果手机，是则是true
          var isIos = ua.indexOf("iphone") != -1 || ua.indexOf("ipad") != -1;
          if (isIos) {
            this.isflageIOX = true;
          } else {
            this.isflageIOX = false;
          }
        },
        getNotification() {
          var getData = localStorage.getItem("key");
          var url = location.search;
          console.log(url, 501);
          console.log(url.split("=")[0].split("?")[1]);
          if (url.split("=")[0].split("?")[1] == "one") {
            this.reportCode = "001";
          } else if (url.split("=")[0].split("?")[1] == "two") {
            this.reportCode = "002";
            console.log("色谱报告", this.reportCode);
          } else if (url.split("=")[0].split("?")[1] == "three") {
            this.reportCode = "003";
            console.log("例行报告", this.reportCode);
          }

          if (getData) {
            if (getData == this.reportCode) {
              console.log(getData, 513);
              console.log(this.reportCode, 514);
              if (getData == "001") {
                localStorage.setItem("notification", "001");
                $(location).attr("href", "recognitionResultOne.html");
              } else if (getData == "002") {
                $(location).attr(
                  "href",
                  "recognitionResultTwo.html?two=flag"
                );
              } else {
                localStorage.setItem("notification", "003");
                $(location).attr("href", "recognitionResultThree.html");
              }
            }
          }
        },
        functionBtn() {
          // 从sessionStorage中取出数据
          if (JSON.parse(sessionStorage.getItem("integralTotal")).ocr <= 0) {
            mui.toast("今日OCR识别次数已用完，明天可以继续使用！", {
              duration: "long",
              type: "div",
            });
            return;
          }
          // 判断IOS/安卓
          if (this.isflageIOX == true) {
            // this.$refs.inputer.dispatchEvent(new MouseEvent("click"));
            // wx.chooseImage上传图片
            wx.chooseImage({
              count: 1, // 默认9
              sizeType: ["original"], // 可以指定是原图还是压缩图，默认二者都有
              sourceType: ["album", "camera"], // 可以指定来源是相册还是相机，默认二者都有
              // quality: 0.1, //压缩质量，范围0～1，数值越小，质量越低，压缩率越高（仅对jpg有效）
              success: (res) => {
                // var localIds = res.localIds[0]; // 返回选定照片的本地ID列表，localId可以作为img标签的src属性显示图片

                $(".loader").css("display", "block");
                $(".curtain").css("display", "block");
                this.slocalResPath = [];
                res.localIds.forEach((item, index) => {
                  this.loopList(item, () => {
                    if (index === res.localIds.length - 1) {
                      // this.checkList = "ios";
                      this.getPrint("ios");
                    }
                  });
                });
              },
            });
          } else {
            wx.chooseImage({
              count: 1, // 默认9
              sizeType: ["original"], // 可以指定是原图还是压缩图，默认二者都有
              sourceType: ["album", "camera"], // 可以指定来源是相册还是相机，默认二者都有
              // quality: 0.1, //压缩质量，范围0～1，数值越小，质量越低，压缩率越高（仅对jpg有效）
              success: (res) => {
                // var localIds = res.localIds[0]; // 返回选定照片的本地ID列表，localId可以作为img标签的src属性显示图片

                $(".loader").css("display", "block");
                $(".curtain").css("display", "block");
                this.slocalResPath = [];
                res.localIds.forEach((item, index) => {
                  this.loopList(item, () => {
                    if (index === res.localIds.length - 1) {
                      // this.checkList = "Android";
                      this.getPrint("Android");
                    }
                  });
                });
              },
            });
          }
        },
        getImage(slocalResPath, localIds) {
          wx.invoke(
            "ext_FileManager_Information",
            {
              data: {
                path: slocalResPath,
              },
            },
            (res) => {
              let str = JSON.parse(res.data);
              str = str.fileSize.split(".");
              if (str[1].indexOf("kB") !== -1) {
                // if (Number(str[0]) >= 15) {
                //     mui.toast("图片大小不能超过15MB", {
                //         duration: "long",
                //         type: "div",
                //     });
                // }
                // else {
                this.getImgBase(localIds);
                // }
              } else {
                this.getImgBase(localIds);
              }
            }
          );
        },
        loopList(localIds, callBack) {
          // let slocalResPath = "";
          wx.invoke(
            "getLocalResPath",
            {
              localId: localIds,
            },
            (res) => {
              // // 当前显示图片的http链接
              this.slocalResPath.push(res.localResPath);
              this.getImage(res.localResPath, localIds);
              callBack();
            }
          );
        },
        getImgBase(localIds) {
          // 处理图片数据为base64
          wx.getLocalImgData({
            localId: localIds,
            success: (res) => {
              var localData = res.localData;
              if (localData.indexOf("data:image") != 0) {
                //判断是否有这样的头部
                localData = "data:image/jpeg;base64," + localData;
              }
              localData = localData
                .replace(/\r|\n/g, "")
                .replace("data:image/jgp", "data:image/jpeg");
              //第一个替换的是换行符，第二个替换的是图片类型，因为在IOS机上测试时看到它的图片类型时jgp，
              //这不知道时什么格式的图片，为了兼容其他设备就把它转为jpeg
              this.addedPreviewFile = localData; // 返回图片的服务器端ID
              // return
              // this.getPrint();
              // }
              // let img = new Image();
              // img.onload = ()=>{
              //     const imgHeight=img.height/document.body.clientHeight

              //     $(".top div").removeClass("line1");
              //     $(".line1 img").removeClass("lineFlag1");
              //     if(imgHeight>0.65){
              //         // alert(document.body.clientHeight*0.3)
              //         $(".top").css("height",document.body.clientHeight*0.65);
              //         $(".top").css("marginTop",0.5+"rem");
              //          $(".top div").addClass("line1");
              //          $(".line1 img").addClass("lineFlag1");
              //     }else{
              //         $(".top").css("height",100+"%");
              //         $(".top").css("marginTop",2.5+"rem");
              //         $(".top div").addClass("line");
              //         $(".line img").addClass("lineFlag");
              //     }

              // }

              // img.src = this.addedPreviewFile;
            },
          });
        },
        // 安卓计算图片大小
        imageSize(base64Str) {
          const indexBase64 = base64Str.indexOf("base64,");
          if (indexBase64 < 0) return -1;
          const str = base64Str.substr(indexBase64 + 6);
          return (str.length * 0.75).toFixed(2);
        },
        funcBtn() {
          // $(".loader").css("display", "block");
          // $(".curtain").css("display", "block");
          // this.$refs.lineFlag.style.display='block'
          let inputDOM = this.$refs.inputer;
          // debugger;
          // this.$refs.flaganimate.style.display = 'block'
          let file = inputDOM.files[0];
          // var path = $(this).val()
          // extStart = path.lastIndexOf('.')
          // ext = path.substring(extStart,path.length).toUpperCase();
          // 获取 ios base64 大小
          //  if(file.size / 1024 > 1024){
          // mui.toast('图片大小不能超过10M', { duration: 'long', type: 'div' })
          //  }else{
          let re = new FileReader();
          re.readAsDataURL(file);
          let that = this;
          re.onload = (re) => {
            that.addedPreviewFile = re.target.result;
            var size = this.showSize(that.addedPreviewFile);
            if (size > 300) {
              mui.toast("图片大小不能超过10M", {
                duration: "long",
                type: "div",
              });
              $(".loader").css("display", "none");
              $(".curtain").css("display", "none");
              that.addedPreviewFile = "";
            } else {
              this.getPrint();
            }
            //  let img = new Image();
            // width = 95,    //图片resize宽度
            // quality = 1.0,  //图像质量
            // canvas = document.createElement("canvas"),
            // drawer = canvas.getContext("2d");
            // img.src = this.result;
            // canvas.width = width;
            // canvas.height = width * (img.height / img.width);
            // drawer.drawImage(img, 0, 0, canvas.width, canvas.height);
            // that.addedPreviewFile = canvas.toDataURL();
            // var image_base64 = that.addedPreviewFile.replace("data:image/png;base64,","");
            // 调用回调
            // callback&&callback(image_base64);
          };
          //  }
        },
        showSize(base64url) {
          //把头部去掉
          var str = base64url.replace("data:image/png;base64,", "");
          // 找到等号，把等号也去掉
          var equalIndex = str.indexOf("=");
          if (str.indexOf("=") > 0) {
            str = str.substring(0, equalIndex);
          }
          // 原来的字符流大小，单位为字节
          var strLength = str.length;
          // 计算后得到的文件流大小，单位为字节
          var fileLength = parseInt(strLength - (strLength / 8) * 2);
          // 由字节转换为kb
          var size = "";
          size = (fileLength / 1024).toFixed(2);
          var sizeStr = size + ""; //转成字符串
          var index = sizeStr.indexOf("."); //获取小数点处的索引
          var dou = sizeStr.substr(index + 1, 2); //获取小数点后两位的值
          if (dou == "00") {
            //判断后两位是否为00，如果是则删除00
            return sizeStr.substring(0, index) + sizeStr.substr(index + 3, 2);
          }
          return size;
        },
        getPrint(ios) {
          // let timestamp = Date.now();
          if (sessionStorage.getItem("iscp_port")) {
            iscp_port = sessionStorage.getItem("iscp_port");
          } else {
            iscp_port = "";
          }
          const timestamp = new Date().getTime() + "";
          // let iscp_port;
          // this.$refs.lineFlag.style.display = "block";
          const regEx = ".+/(.+)$";
          let datas = {
            // img: this.addedPreviewFile,
            // base: this.addedPreviewFile,
            cellphone: ios,
            // code
            reportCode: this.reportCode,
          },
            files = {};
          this.slocalResPath.forEach((item, index) => {
            datas["filename" + index] = item.match(regEx)[0];
            datas["originalname" + index] = item.match(regEx)[0];
            files["file"] = item;
          });
          // data = JSON.stringify(data);
          const userId = sessionStorage.getItem("userId");
          let AuthenticationSession =
            sessionStorage.getItem("Authentication");
          let sign3 = sm3(timestamp + "&" + userId);
          // return;
          var channelId = "net_upload_" + this.createNonceStr(8);
          var param = {
            id: channelId,
            timeout: "180",
            // url: localUrlLink + iscp_port + '/ai/prod-api/api-ocr/v1/ocrservice/default/default/biz-gzp',
            // url:
            // localUrlLink + iscp_port + "/tjAiAssistant/Report/recognition",
            url: localUrlLink + iscp_port + "/yipailu/Report/recognition",
            data: datas,
            files: files,
            header: {
              "Content-Type": "application/json;charset=UTF-8",
              sign: sign3,
              Authentication: AuthenticationSession,
              timestamp: timestamp,
              userId: userId,
            },
          };
          $(".loader").css("display", "none");
          $(".curtain").css("display", "none");
          this.$refs.lineFlag.style.display = "block";
          wx.invoke(
            "ext_Net_Upload",
            {
              data: param,
            },
            (res) => {
              if (res.event == "fail") {
                $(".loader").css("display", "none");
                $(".curtain").css("display", "none");
                this.$refs.lineFlag.style.display = "none";
                mui.toast("当前请求超时", {
                  duration: "long",
                  type: "div",
                });
              } else {
                console.log(res, 802);
                const result = JSON.parse(res.result);
                console.log(result, 804);
                // return;
                if (result.code == 200) {
                  this.$refs.lineFlag.style.display = "none";
                  const resultValue = JSON.parse(result.resultValue);
                  console.log(resultValue, 809);
                  // return;
                  let res1 = resultValue.result;
                  let obj = JSON.stringify(res1);
                  let res2 = resultValue.color;
                  let color = JSON.stringify(res2);
                  // 存储localStorage
                  localStorage.setItem("fileName", resultValue.fileName);
                  sessionStorage.setItem(
                    "tAttachmentId",
                    resultValue.tAttachmentId
                  );
                  // 存储localstorage
                  localStorage.setItem("key", resultValue.reportCode);
                  localStorage.setItem("clipboard", obj);
                  localStorage.setItem("color", color);
                  // return
                  mui.toast("上传成功", {
                    duration: "long",
                    type: "div",
                  });
                  console.log(resultValue.reportCode, 836);
                  if (resultValue.reportCode == "001") {
                    $(location).attr("href", "recognitionResultOne.html");
                  } else if (resultValue.reportCode == "002") {
                    $(location).attr("href", "recognitionResultTwo.html");
                  } else if (resultValue.reportCode == "003") {
                    $(location).attr("href", "recognitionResultThree.html");
                  }
                } else if (result.code == 500) {
                  this.$refs.lineFlag.style.display = "none";
                  $(".loader").css("display", "none");
                  $(".curtain").css("display", "none");
                  mui.toast(result.resultValue, {
                    duration: "long",
                    type: "div",
                  });
                } else {
                  this.$refs.lineFlag.style.display = "none";
                  $(".loader").css("display", "none");
                  $(".curtain").css("display", "none");
                  mui.toast("上传失败", {
                    duration: "long",
                    type: "div",
                  });
                }
              }
            }
          );
        },
        createNonceStr(len) {
          var e = len ? len : 16;
          var t =
            "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
            a = t.length,
            n = "";
          for (i = 0; i < e; i++)
            n += t.charAt(Math.floor(Math.random() * a));
          return n;
        },
        // 发送邮箱
        mailbox() {
          return;
          $(".loader").css("display", "block");
          $(".curtain").css("display", "block");
          let data = {
            sceneName: "工作票识别", //场景名称(身份证识别、增值税识别、火车票识别、手写文字识别、打印文字识别、pdf转word）
            sceneNo: "10",
            fileName: "工作票识别.txt", //文本名称
            fileExt: "txt", //文本后缀名称
            fileContent: this.clipboard.content, //识别后内容
            orgId: "1", //单位id
            userId: userId, //用户id
            userName: userName, //用户名称
            toMail: toMail, //发送给谁 453707600@qq.com  15146764979@163.com
            timestamp: new Date().getTime() + "",
          };

          let mailboxReturn = mailbox(
            data.sceneNo,
            data.fileName,
            data.fileExt,
            data.fileContent,
            data.orgId,
            data.userId,
            data.userName,
            data.toMail,
            data.timestamp
          );
          if (mailboxReturn == 200) {
            addOperator(2, 10, "发送邮箱", 1, 1, "发送邮箱成功");
          } else {
            addOperator(2, 10, "发送邮箱", 1, 0, "发送邮箱失败");
          }
        },
        //复制按钮
        copy() {
          let text1 = this.clipboard.content;
          var clipboard = new Clipboard(".tag-read", {
            // 通过target指定要复印的节点
            text: function () {
              return text1;
            },
          });

          clipboard.on("success", (e) => {
            addOperator(2, 10, "复制文本", 1, 1, "复制成功");
            mui.toast("复制成功", { duration: "long", type: "div" });
          });

          clipboard.on("error", (e) => {
            addOperator(2, 10, "复制文本", 1, 0, "复制失败");
          });
        },
        home() {
          $(location).attr("href", "Home.html");
        },
        createSgin(data) {
          let hashData = sm3(data);
          let hashData_last = sm3(hashData);
          hashData_last = hashData_last.substr(0, 5);
          hashData += hashData_last;
          let sign = hashData;
          return sign;
        },
      },
    });
  </script>
</body>

</html>

<body></body>